<template>
    <div>
        <div class="item" v-for="(item,index) of list" :key="index">
            <div class="item-title">
                <span class="item-title-icon">
                    {{item.title}}
                </span>
            </div>
            <div class="item-children" v-if="item.children"><!--如果判断有children数据，则说明这是一个多级表栏-->
                <detail-list :list="item.children"></detail-list>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name:'DetailList',//这个名字很大的用处就是在自己的组件中使用自己
    props:{
        list:Array
    }
}
</script>

<style lang="stylus" scoped>
    .item-title-icon{
        position relative
        left: .06rem
        top: .06rem
        width 0.36rem
        height 0.36rem
        // background: url(http://s.qunarzz.com/piao/img/touch/sight/detail.png) 0 -.45rem no-repeat
        margin-right: .1rem
        background-size: .4rem 3rem
    }
    .item-title{
        height: .8rem
        overflow hidden
        line-height: .8rem
        font-size: .32rem
        padding: 0 .2rem
        border-bottom: solid black .01rem 
    }
    .item-children{
        padding: 0 .2rem
    }
</style>